package com.MartynovichIgor.KnowledgeTest.tools.admintools;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by:
 * User: Igor Martynovich and Guzenko Igor
 * Date: 04.11.13
 */
public class AdminChecker {
    private final String ADMIN_LOGIN = "i";
    private final String ADMIN_PASSWORD = "1";

    public boolean isAdmin(String userLogin) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        if (userLogin.equals(ADMIN_LOGIN)) {
            String userPassword = reader.readLine();
            if(userPassword.equals(ADMIN_PASSWORD)) {
                return true;
            }
        }
        return false;
    }
}
